home *** CD-ROM | disk | FTP | other *** search
- property pNewLoc, pMode
-
- on beginSprite me
- sprite(me.spriteNum).cursor = 280
- pMode = #normal
- end
-
- on mouseUp me
- sendSprite(0, #clickPuzzle, me.spriteNum)
- end
-
- on changeLoc me, newLoc
- pNewLoc = newLoc
- pMode = #animate
- end
-
- on exitFrame me
- if pMode = #animate then
- curloc = sprite(me.spriteNum).loc
- if curloc.locH < pNewLoc.locH then
- curloc = curloc + point(4, 0)
- else
- if curloc.locH > pNewLoc.locH then
- curloc = curloc - point(4, 0)
- else
- if curloc.locV < pNewLoc.locV then
- curloc = curloc + point(0, 4)
- else
- if curloc.locV > pNewLoc.locV then
- curloc = curloc - point(0, 4)
- end if
- end if
- end if
- end if
- sprite(me.spriteNum).loc = curloc
- if curloc = pNewLoc then
- sendSprite(0, #resetMode)
- pMode = #normal
- end if
- end if
- end
-